package com.backend.modules.notification.schedule;

import com.backend.modules.notification.repository.NotificationRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;

@Component
@RequiredArgsConstructor
public class NotificationSchedule {

    private final NotificationRepository notificationRepository;
    
//    /**
//     * 每天凌晨2点清理过期通知
//     */
//    @Scheduled(cron = "0 0 2 * * ?")
//    @Transactional(rollbackFor = Exception.class)
//    public void cleanExpiredNotifications() {
//        notificationRepository.deleteExpired(LocalDateTime.now());
//    }
}